#include<stdio.h>
int main()
{
	int n,cout=0;
	scanf("%d",&n);
	while(n>1){
		if(n<11){
		      if(n%2==0){
			    while(n%2==0){
			    	n=n/2;
			    	printf("^"); 
			    	cout++;
			  }
			  }
			  else {
			  n--;
			  printf("-");
			  cout++;
		}
		}
		else{
			if(n%2==0){while(n%2==0){
				n=n/2;
				printf("^");
				cout++;
			}
		}
			else {
				if((n+1)%4==0){
					n++;
					printf("+");
					cout++; 
				}
				else{
					n--;
					printf("-");
					cout++;
				}
			}
			} 
		}
	printf("\n");
	printf("%d",cout);
	return 0;
 } 
